package main

import (
	"fmt"
	"hanmoon-product/common"
	RabbitMQ "hanmoon-product/rabbitmq"
	"hanmoon-product/repositories"
	"hanmoon-product/services"
)

func main() {
	conn, err := common.NewMysqlConn()
	if err != nil {
		fmt.Println(err)
	}
	//创建prodcut数据库操作实例
	product := repositories.NewProductManager("product", conn)
	productService := services.NewProductService(product)
	order := repositories.NewOrderMangerRepository("order", conn)
	orderService := services.NewOrderService(order)

	rabbitmqConsumerSimple := RabbitMQ.NewRabbitSimple("hanmoonProduct")

	rabbitmqConsumerSimple.ConsumeSimple(orderService, productService)

}
